(function($){
    var setting={'width':200,'height':150};
    $(document).ready(function(){
        var base=setting.height/setting.width;
        $('#result_list tr th img').each(function(i,el){
            var imgWidth=$(el).width();
            var imgHeight=$(el).height();
            var imgBase=imgHeight/imgWidth;
            if(base==imgBase){
                $(el).width(setting.width);
                $(el).height(setting.height);
            }
            else if(imgBase<base){
                $(el).width(setting.width);
                $(el).height(imgHeight/imgWidth*setting.width);
            }
            else{
                $(el).height(setting.height);
                $(el).width(imgWidth/imgHeight*setting.height);
            }
        })
    })
} )(django.jQuery)